x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86
authorKeir Fraser <keir@xen.org>
Sun, 15 Jan 2012 22:02:35 +0000 (22:02 +0000)
committerKeir Fraser <keir@xen.org>
Sun, 15 Jan 2012 22:02:35 +0000 (22:02 +0000)
Signed-off-by: Keir Fraser <keir@xen.org>
19 files changed:
xen/arch/x86/acpi/power.c
xen/arch/x86/hvm/svm/asid.c
xen/arch/x86/hvm/svm/intr.c
xen/arch/x86/hvm/svm/nestedsvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/intr.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/arch/x86/irq.c
xen/arch/x86/trace.c
xen/arch/x86/traps.c
xen/arch/x86/x86_32/traps.c
xen/arch/x86/x86_64/traps.c
xen/include/asm-x86/config.h
xen/include/asm-x86/hvm/vmx/vvmx.h
xen/include/asm-x86/irq.h
xen/include/asm-x86/processor.h
xen/include/asm-x86/x86_32/asm_defns.h
xen/include/asm-x86/x86_64/asm_defns.h

index 7bcc381fe4bea3b3c373d637746789ec90bc7ccb..4b242043c82c5e9cdda36ebbab7978b88ca39dcd 100644 (file)
@@ -311,7 +311,7 @@ static void tboot_sleep(u8 sleep_state)
 }
 
 /* System is really put into sleep state by this stub */
-acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state)
+acpi_status acpi_enter_sleep_state(u8 sleep_state)
 {
     acpi_status status;
 
index ede2be6cc5b2ff099c617c0c7f3a74a11c8c87e2..14e2abd9198f49f58642ae35612bea9a313515db 100644 (file)
@@ -39,7 +39,7 @@ void svm_asid_init(struct cpuinfo_x86 *c)
  * Called directly before VMRUN.  Checks if the VCPU needs a new ASID,
  * assigns it, and if required, issues required TLB flushes.
  */
-asmlinkage void svm_asid_handle_vmrun(void)
+void svm_asid_handle_vmrun(void)
 {
     struct vcpu *curr = current;
     struct vmcb_struct *vmcb = curr->arch.hvm_svm.vmcb;
index 973373d7ab1a6f1a41de2b6d7056e7a3b0163919..78f6908f82d391347ac9b5cc80b2febfbb7c8783 100644 (file)
@@ -132,7 +132,7 @@ static void enable_intr_window(struct vcpu *v, struct hvm_intack intack)
         vmcb, general1_intercepts | GENERAL1_INTERCEPT_VINTR);
 }
 
-asmlinkage void svm_intr_assist(void) 
+void svm_intr_assist(void) 
 {
     struct vcpu *v = current;
     struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
index 40a68bf898c1383a9727b898bc7aa4f3c143a269..8714bb0d440e9e58617eb2753a3335b152584ec6 100644 (file)
@@ -1404,7 +1404,7 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, struct cpu_user_regs *regs,
 }
 
 /* VCPU switch */
-asmlinkage void nsvm_vcpu_switch(struct cpu_user_regs *regs)
+void nsvm_vcpu_switch(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nv;
index 6986f4a97f55ee6ace2f44fccbe04fe2df0b4af1..e4b41c44705f5a7aa103f206d1756c79bf222bcd 100644 (file)
@@ -1843,7 +1843,7 @@ static struct hvm_function_table __read_mostly svm_function_table = {
     .nhvm_intr_blocked = nsvm_intr_blocked,
 };
 
-asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
+void svm_vmexit_handler(struct cpu_user_regs *regs)
 {
     uint64_t exit_reason;
     struct vcpu *v = current;
@@ -2249,7 +2249,7 @@ asmlinkage void svm_vmexit_handler(struct cpu_user_regs *regs)
     vmcb_set_vintr(vmcb, intr);
 }
 
-asmlinkage void svm_trace_vmentry(void)
+void svm_trace_vmentry(void)
 {
     struct vcpu *curr = current;
     HVMTRACE_ND(VMENTRY,
index b44839163f9679d11f7606dde0b68a690a41a66f..d675011042a979d799fd0879577a7827d32d2ce6 100644 (file)
@@ -200,7 +200,7 @@ static int nvmx_intr_intercept(struct vcpu *v, struct hvm_intack intack)
     return 0;
 }
 
-asmlinkage void vmx_intr_assist(void)
+void vmx_intr_assist(void)
 {
     struct hvm_intack intack;
     struct vcpu *v = current;
index 414414f14327ccda6224657545cd461f20550900..81e8b82ca5bd1d9286a7061dc19cb7d0cdba27e0 100644 (file)
@@ -2169,7 +2169,7 @@ static void vmx_failed_vmentry(unsigned int exit_reason,
     domain_crash(curr->domain);
 }
 
-asmlinkage void vmx_enter_realmode(struct cpu_user_regs *regs)
+void vmx_enter_realmode(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -2251,7 +2251,7 @@ static void vmx_idtv_reinject(unsigned long idtv_info)
     }
 }
 
-asmlinkage void vmx_vmexit_handler(struct cpu_user_regs *regs)
+void vmx_vmexit_handler(struct cpu_user_regs *regs)
 {
     unsigned int exit_reason, idtv_info, intr_info = 0, vector = 0;
     unsigned long exit_qualification, inst_len = 0;
@@ -2718,7 +2718,7 @@ out:
         nvmx_idtv_handling();
 }
 
-asmlinkage void vmx_vmenter_helper(void)
+void vmx_vmenter_helper(void)
 {
     struct vcpu *curr = current;
     u32 new_asid, old_asid;
index 31682edd791e1aefe191910de3236f8ae78f4e42..ae5c766d48b21baa881bf0272ba0c38a05c2a669 100644 (file)
@@ -968,7 +968,7 @@ static void virtual_vmexit(struct cpu_user_regs *regs)
     vmreturn(regs, VMSUCCEED);
 }
 
-asmlinkage void nvmx_switch_guest(void)
+void nvmx_switch_guest(void)
 {
     struct vcpu *v = current;
     struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v);
index bfdfa2638e497d5a1d99b527bade8791a05c4be4..058f89df144fad20484c98cd6c1a89c4000a6660 100644 (file)
@@ -757,7 +757,7 @@ void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
-asmlinkage void do_IRQ(struct cpu_user_regs *regs)
+void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
     uint32_t          tsc_in;
index 3ae3e2d40de15e85b2e28e7204e7ce6247be478b..404f2931884a261fe5eecc1a73d77c4fe7979fa5 100644 (file)
@@ -11,7 +11,7 @@
 #define TRC_64_FLAG 0
 #endif
 
-asmlinkage void trace_hypercall(void)
+void trace_hypercall(void)
 {
     struct cpu_user_regs *regs = guest_cpu_user_regs();
 
index 2d585c8c43963e61763ba3643734735f41f553db..b6f7b9ac40ceceb7cbaea46f6b89dcef1731cc62 100644 (file)
@@ -425,7 +425,7 @@ static char *trapstr(int trapnr)
  * are disabled). In such situations we can't do much that is safe. We try to
  * print out some tracing and then we just spin.
  */
-asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs)
+void fatal_trap(int trapnr, struct cpu_user_regs *regs)
 {
     static DEFINE_PER_CPU(char, depth);
 
@@ -539,7 +539,7 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
  * Called from asm to set up the MCE trapbounce info.
  * Returns 0 if no callback is set up, else 1.
  */
-asmlinkage int set_guest_machinecheck_trapbounce(void)
+int set_guest_machinecheck_trapbounce(void)
 {
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
@@ -553,7 +553,7 @@ asmlinkage int set_guest_machinecheck_trapbounce(void)
  * Called from asm to set up the NMI trapbounce info.
  * Returns 0 if no callback is set up, else 1.
  */
-asmlinkage int set_guest_nmi_trapbounce(void)
+int set_guest_nmi_trapbounce(void)
 {
     struct vcpu *v = current;
     struct trap_bounce *tb = &v->arch.pv_vcpu.trap_bounce;
@@ -601,13 +601,13 @@ static inline void do_trap(
 }
 
 #define DO_ERROR_NOCODE(trapnr, name)                   \
-asmlinkage void do_##name(struct cpu_user_regs *regs)   \
+void do_##name(struct cpu_user_regs *regs)   \
 {                                                       \
     do_trap(trapnr, regs, 0);                           \
 }
 
 #define DO_ERROR(trapnr, name)                          \
-asmlinkage void do_##name(struct cpu_user_regs *regs)   \
+void do_##name(struct cpu_user_regs *regs)   \
 {                                                       \
     do_trap(trapnr, regs, 1);                           \
 }
@@ -977,7 +977,7 @@ static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
     return EXCRET_fault_fixed;
 }
 
-asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
+void do_invalid_op(struct cpu_user_regs *regs)
 {
     struct bug_frame bug;
     struct bug_frame_str bug_str;
@@ -1071,7 +1071,7 @@ asmlinkage void do_invalid_op(struct cpu_user_regs *regs)
     panic("FATAL TRAP: vector = %d (invalid opcode)\n", TRAP_invalid_op);
 }
 
-asmlinkage void do_int3(struct cpu_user_regs *regs)
+void do_int3(struct cpu_user_regs *regs)
 {
     DEBUGGER_trap_entry(TRAP_int3, regs);
 
@@ -1084,7 +1084,7 @@ asmlinkage void do_int3(struct cpu_user_regs *regs)
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-asmlinkage void do_machine_check(struct cpu_user_regs *regs)
+void do_machine_check(struct cpu_user_regs *regs)
 {
     machine_check_vector(regs, regs->error_code);
 }
@@ -1385,7 +1385,7 @@ static int fixup_page_fault(unsigned long addr, struct cpu_user_regs *regs)
  *  Bit 3: Reserved bit violation
  *  Bit 4: Instruction fetch
  */
-asmlinkage void do_page_fault(struct cpu_user_regs *regs)
+void do_page_fault(struct cpu_user_regs *regs)
 {
     unsigned long addr, fixup;
     unsigned int error_code;
@@ -1451,7 +1451,7 @@ asmlinkage void do_page_fault(struct cpu_user_regs *regs)
  * during early boot (an issue was seen once, but was most likely a hardware 
  * problem).
  */
-asmlinkage void __init do_early_page_fault(struct cpu_user_regs *regs)
+void __init do_early_page_fault(struct cpu_user_regs *regs)
 {
     static int stuck;
     static unsigned long prev_eip, prev_cr2;
@@ -3049,7 +3049,7 @@ static void emulate_gate_op(struct cpu_user_regs *regs)
 #endif
 }
 
-asmlinkage void do_general_protection(struct cpu_user_regs *regs)
+void do_general_protection(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
     unsigned long fixup;
@@ -3307,7 +3307,7 @@ static int dummy_nmi_callback(struct cpu_user_regs *regs, int cpu)
  
 static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
-asmlinkage void do_nmi(struct cpu_user_regs *regs)
+void do_nmi(struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
@@ -3343,7 +3343,7 @@ void unset_nmi_callback(void)
     nmi_callback = dummy_nmi_callback;
 }
 
-asmlinkage void do_device_not_available(struct cpu_user_regs *regs)
+void do_device_not_available(struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
 
@@ -3384,7 +3384,7 @@ static void ler_enable(void)
     wrmsrl(MSR_IA32_DEBUGCTLMSR, debugctl | 1);
 }
 
-asmlinkage void do_debug(struct cpu_user_regs *regs)
+void do_debug(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
 
@@ -3435,7 +3435,7 @@ asmlinkage void do_debug(struct cpu_user_regs *regs)
     return;
 }
 
-asmlinkage void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
+void do_spurious_interrupt_bug(struct cpu_user_regs *regs)
 {
 }
 
index ac88aefd977e1fba85d724db7e13b419da1c6fd6..8f68808da8ec172179b83a333a380773e3942818 100644 (file)
@@ -231,7 +231,7 @@ static struct notifier_block cpu_doublefault_tss_nfb = {
     .notifier_call = cpu_doublefault_tss_callback
 };
 
-asmlinkage void do_double_fault(void)
+void do_double_fault(void)
 {
     struct tss_struct *tss;
     unsigned int cpu;
index 38ce30300c26e5ec194d5e5d4f1ed3dff67ce55b..b6f1e61cafca7463ebf48d956d8fd9c1f06a7286 100644 (file)
@@ -216,8 +216,8 @@ void show_page_walk(unsigned long addr)
            l1_table_offset(addr), l1e_get_intpte(l1e), pfn);
 }
 
-asmlinkage void double_fault(void);
-asmlinkage void do_double_fault(struct cpu_user_regs *regs)
+void double_fault(void);
+void do_double_fault(struct cpu_user_regs *regs)
 {
     unsigned int cpu;
 
index c5dd02a3ed5750ba5c189076877c1576aceb3b7c..e8f82116227558b75df6d422f2eca587368e887c 100644 (file)
@@ -119,13 +119,13 @@ extern unsigned short boot_edid_caps;
 extern unsigned char boot_edid_info[128];
 #endif
 
+#define asmlinkage
+
 #if defined(__x86_64__)
 
 #define CONFIG_X86_64 1
 #define CONFIG_COMPAT 1
 
-#define asmlinkage
-
 #define PML4_ENTRY_BITS  39
 #ifndef __ASSEMBLY__
 #define PML4_ENTRY_BYTES (1UL << PML4_ENTRY_BITS)
@@ -289,8 +289,6 @@ extern unsigned char boot_edid_info[128];
 #define CONFIG_X86_32      1
 #define CONFIG_DOMAIN_PAGE 1
 
-#define asmlinkage __attribute__((regparm(0)))
-
 /*
  * Memory layout (high to low):                          PAE-SIZE
  *                                                       ------
index 19fe26d68618a4e300bf20b87174b460c626fa1a..995f9f4ff4860fbe141650327b29457f3fef43f6 100644 (file)
@@ -172,7 +172,7 @@ void nvmx_update_exec_control(struct vcpu *v, u32 value);
 void nvmx_update_secondary_exec_control(struct vcpu *v,
                                         unsigned long value);
 void nvmx_update_exception_bitmap(struct vcpu *v, unsigned long value);
-asmlinkage void nvmx_switch_guest(void);
+void nvmx_switch_guest(void);
 void nvmx_idtv_handling(void);
 u64 nvmx_get_tsc_offset(struct vcpu *v);
 int nvmx_n2_vmexit_handler(struct cpu_user_regs *regs,
index 31475f62f65ad90bc3533bfc14df3847c5078eba..b9bd924932c6586eae6f43c3dbb191f4afc2c818 100644 (file)
@@ -101,7 +101,7 @@ fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs);
 fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
 fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
-asmlinkage void do_IRQ(struct cpu_user_regs *regs);
+void do_IRQ(struct cpu_user_regs *regs);
 
 void disable_8259A_irq(struct irq_desc *);
 void enable_8259A_irq(struct irq_desc *);
index 68684b92ae7fdd453cf3251a11df8cb2d35dfeaf..c314f1e79608d069c78c37c3e53ae0a919d01189 100644 (file)
@@ -549,7 +549,7 @@ void show_registers(struct cpu_user_regs *regs);
 void show_execution_state(struct cpu_user_regs *regs);
 #define dump_execution_state() run_in_exception_handler(show_execution_state)
 void show_page_walk(unsigned long addr);
-asmlinkage void fatal_trap(int trapnr, struct cpu_user_regs *regs);
+void fatal_trap(int trapnr, struct cpu_user_regs *regs);
 
 #ifdef CONFIG_COMPAT
 void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
@@ -563,8 +563,8 @@ extern void mtrr_bp_init(void);
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
 #define DECLARE_TRAP_HANDLER(_name)                     \
-asmlinkage void _name(void);                            \
-asmlinkage void do_ ## _name(struct cpu_user_regs *regs)
+void _name(void);                            \
+void do_ ## _name(struct cpu_user_regs *regs)
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
 DECLARE_TRAP_HANDLER(nmi);
@@ -586,13 +586,13 @@ DECLARE_TRAP_HANDLER(alignment_check);
 DECLARE_TRAP_HANDLER(spurious_interrupt_bug);
 #undef DECLARE_TRAP_HANDLER
 
-asmlinkage void syscall_enter(void);
-asmlinkage void sysenter_entry(void);
-asmlinkage void sysenter_eflags_saved(void);
-asmlinkage void compat_hypercall(void);
-asmlinkage void int80_direct_trap(void);
+void syscall_enter(void);
+void sysenter_entry(void);
+void sysenter_eflags_saved(void);
+void compat_hypercall(void);
+void int80_direct_trap(void);
 
-extern asmlinkage int hypercall(void);
+extern int hypercall(void);
 
 int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
           uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
index 93f25d8ba3052a9049b922460c7ade26e251fc60..cd869e174f251c1a51b8e72c5ca2e70ae3a06000 100644 (file)
@@ -138,7 +138,7 @@ __asm__(                                        \
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
 
 #define BUILD_IRQ(nr)                           \
-asmlinkage void IRQ_NAME(nr);                   \
+void IRQ_NAME(nr);                   \
 __asm__(                                        \
 "\n"__ALIGN_STR"\n"                             \
 STR(IRQ) #nr "_interrupt:\n\t"                  \
index b90c1a5ab71c597aeca6b7ffdd653ff630baccf0..a3b8200e33f5821a00b965844ce4c14d4fb44d17 100644 (file)
@@ -116,7 +116,7 @@ __asm__(                                        \
 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
 
 #define BUILD_IRQ(nr)                           \
-asmlinkage void IRQ_NAME(nr);                   \
+void IRQ_NAME(nr);                   \
 __asm__(                                        \
 "\n"__ALIGN_STR"\n"                             \
 STR(IRQ) #nr "_interrupt:\n\t"                  \